import request from ".";

export const getCanteen = () => {
  return request({
    url: "/manageCanteen/getCanteen",
    method: "get",
  });
};

export const findCanteen = (c_name) => {
  return request({
    url: "/manageCanteen/findCanteen",
    method: "get",
    params: {
      canteen_name: c_name,
    },
  });
};

export const delCanteen = (c_id) => {
  return request({
    url: "/manageCanteen/deleteCanteen",
    method: "post",
    data: {
      canteen_id: c_id,
    },
  });
};

export const addCanteen = (c_name) => {
  return request({
    url: "/manageCanteen/addCanteen",
    method: "post",
    data: {
      canteen_name: c_name,
    },
  });
};

export const updateCanteen = (c_id, c_name) => {
  return request({
    url: "/manageCanteen/updateCanteen",
    method: "post",
    data: {
      canteen_id: c_id,
      canteen_name: c_name,
    },
  });
};

export const changeCanteenPhoto = (c_id, files) => {
  return request({
    url: "/manageCanteen/changeCanPhoto",
    method: "post",
    data: {
      canteen_id: c_id,
      files: files,
    },
  });
};
